<?php
@header("Content-type: text/html");

include_once('html_functions.php');

$width = 200;
$height = 15;
?>
<pre>generator|Internode Usage v.<?= $this->api->internode_version ?> - PHP <?= phpversion() ?> <?= strftime("%d/%m/%Y %H:%M:%S %Z") ?> 
account|<?= $this->api->username ?>@internode.on.net
used|<?= sprintf("%f", $this->api->used/1000 ) ?> Gb</pre>
<? if(!$this->api->unlimited) : ?>
<pre>quota|<?= sprintf("%.2f", $this->api->quota/1000 ) ?> Gb
remaining|<?= sprintf("%.2f", $this->api->quota_remaining/1000 ) ?> Gb
percentage|<?= sprintf("%.2f", $this->api->quota_percentage ) ?>%
remaining per day|<?= sprintf("%.2f", ($this->api->quota_remaining / $this->api->days_remaining) ) ?> Mb</pre>

<table style="font: normal <?= $height * 0.8 ?>px/<?= $height ?>px Arial, sans-serif;">
	<tr>
		<td title="<?= sprintf("%f", $this->api->used/1000 ) ?> Gb"><?= sprintf("%.2f%%", $this->api->quota_percentage)?></td>
		<td><?= div_bar_graph($width,$height,$this->api->quota_percentage/100) ?></td>
		<td title="<?= sprintf("%.2f", $this->api->quota_remaining/1000 ) ?> Gb"><?= sprintf("%.2f%%", 100-$this->api->quota_percentage) ?></td>
	</tr>
	<tr>
		<td><?= 30-$this->api->days_remaining ?></td>
		<td><?= div_bar_graph($width,$height,1-($this->api->days_remaining / 30)) ?></td>
		<td><?= $this->api->days_remaining ?></td>
	</tr>
</table>
<? endif; ?>